﻿using System;

namespace LD.Host
{
    public partial class FrmSysSet : BaseFrm
    {
        public FrmSysSet()
        {
            InitializeComponent();
            this.Shown += FrmSysSet_Shown;
        }

        private void FrmSysSet_Shown(object sender, EventArgs e)
        {
            this.sw_vision.Checked = (bool)Cache.GetCache(CONST.VISION);// CacheHelper1.GetStruct<bool>(CONST.VISION);
            this.sw_bc.Checked = (bool)Cache.GetCache(CONST.BC);
            this.sw_mes.Checked = (bool)Cache.GetCache(CONST.MES);

            //MES开关
            this.sw_byd.Checked = (bool)Cache.GetCache(CONST.BYD);
            this.sw_hq.Checked = (bool)Cache.GetCache(CONST.华勤);
            this.sw_ls.Checked = (bool)Cache.GetCache(CONST.蓝思);
            this.sw_fsk.Checked = (bool)Cache.GetCache(CONST.富士康);
            this.sw_dw.Checked = (bool)Cache.GetCache(CONST.朵唯);
            this.sw_sharp.Checked = (bool)Cache.GetCache(CONST.夏普);
            this.sw_hyfsk.Checked = (bool)Cache.GetCache(CONST.衡阳富士康);
        }

        public void Save()
        {
            Cache.SetCache(CONST.BC, this.sw_bc.Checked);
            Cache.SetCache(CONST.MES, this.sw_mes.Checked);
            Cache.SetCache(CONST.VISION, this.sw_vision.Checked);


            //MES开关
            Cache.SetCache(CONST.BYD, this.sw_byd.Checked);
            Cache.SetCache(CONST.华勤, this.sw_hq.Checked);
            Cache.SetCache(CONST.夏普, this.sw_sharp.Checked);
            Cache.SetCache(CONST.富士康, this.sw_fsk.Checked);
            Cache.SetCache(CONST.朵唯, this.sw_dw.Checked);
            Cache.SetCache(CONST.蓝思, this.sw_ls.Checked);
            Cache.SetCache(CONST.衡阳富士康, this.sw_hyfsk.Checked);

        }
    }
}
